﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

public partial class AdminCMS_tab_Link_List : System.Web.UI.Page
{
    
    protected void Page_Load(object sender, EventArgs e)
    {
        //RequestQuery.SetQueryValues();
        if (!IsPostBack)
        {
            ProSplitPage1.DataSource = GetPagingData();  //给分页控件附值
            //ProSplitPage1.AppendQuery = RequestQuery.GetQueryValues();
            repeater1.DataSource = ProSplitPage1.SplitSource(); //返回拆分结果
            repeater1.DataBind();
        }
    }

    #region 分页方法        
        
        public DataSet GetPagingData()
        {            
            StringBuilder sql = new StringBuilder();
            sql.Append(
@"SELECT lnk_ID,lnk_LinkObject,lnk_LinkURL,lnk_LogoURL,lnk_Message,lnk_PubDate,lnk_SortNum
FROM [tab_Link]");
            /* 追加条件*/
            //sql.Append(" WHERE 1 = 1");
            string Primary = "lnk_ID"; //主键
            string Orderby = "lnk_SortNum";  //排序
            return DataEntity.Common.ExecuteSplitPage(sql.ToString(), Primary, Orderby, ProSplitPage1.MaxRows, ProSplitPage1.PageIndex);
        }
        #endregion
}
